package com.fll.fangyiuser.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.fll.fangyicommon.entity.user.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * @author fll
 * @create 2023/2/24
 */
@Mapper
public interface LoginDao extends BaseMapper<User> {

    /**
     * 注册
     * @param user
     * @return
     */
    int register(User user);

    /**
     * 验证手机号是否注册
     * @param phone
     * @return
     */
    User verifyRegistered(String phone);

    /**
     * 登录接口，手机号和密码登录
     * @param phone
     * @param pass
     * @return
     */
    User login(String phone, String pass);

    /**
     * 根据手机号查询用户
     * @param phone
     * @return
     */
    User getUserByPhone(String phone);

    /**
     * 重置密码
     * @param userId
     * @param pass
     * @return
     */
    int resetPass(@Param("Integer") Integer userId, @Param("String") String pass);

}
